﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//machineID + type + barcode
namespace Hypermarket_Serial_Port
{
    class PriceTagController
    {
        private static PriceTagController mInstance;
        private PriceTagController() { }

        public static PriceTagController getInstance()
        {
            if (mInstance == null)
            {
                mInstance = new PriceTagController();
            }
            return mInstance;
        }

        #region Operation
        public List<string> Operation(List<string> MessageInput)
        {
            try
            {
                byte num_InfoType = Convert.ToByte(MessageInput[1]);
                //MessageInput.RemoveAt(1);
                switch (num_InfoType)
                {
                    #region CASE 02 Check Info
                    case(byte)STATE.PriceTagInfo:
                        Console.WriteLine("Case Price Tag Info");
                        PriceTagTaskManager ProductInfo = new CheckInformationManager();
                        //Console.WriteLine("Case Cashier LogIn");
                        return ProductInfo.TaskOperation(MessageInput);
                    #endregion

                    default:
                        //Console.WriteLine("not a valid case");
                        List<string> output = new List<string>();
                        output.Add(Constant.FAIL);
                        return output;
                        //break;
                }
                //return Constant.TYPE_ERROR;
            }
            catch
            {
                //return Constant.PROGRAM_ERROR;
                throw;
            }
        }
        #endregion
    }
}
